<div id="divlogged">
<span id="loggedspan">Logged in as <span id="userlogged">
<?php 
	@session_start();
	echo $_SESSION['username'];
?></span></span>
<br/>
<img src="img/usericon.png" height="50" width="50" id="userimg"/>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" id="outform">
	<input type="submit" value="Sign Out" id="signout" name="signout" />
</form> 
</div>
<?php 
	if(isset($_POST['signout']))
	{
		session_destroy();
		$_SESSION["userLogged"] = false;
		header('Location:index.php');
	}
?>